package com.theorydance.springsourcestudy.autowired.service;

import com.theorydance.springsourcestudy.autowired.entity.Person;
import com.theorydance.springsourcestudy.autowired.entity.impl.Student;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import java.util.List;

@Component
public class PersonService {
    @Autowired
    private List<Person> personList;
    @Autowired
    private Student stu;

    public PersonService(){
        System.out.println("this is PersonService()");
    }

    @PostConstruct
    public void init(){
        System.out.println("personList = " + personList);
        System.out.println("student = " + stu);
    }

}
